<%@ page language="java"
	import="com.byxy.model.FlowInfo , com.byxy.service.FlowInfoServiceImpl, com.byxy.util.DateUtil"
	pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>update.jsp</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" type="text/css" href="Styles/bootstrap.min2.css" />

<script language="javascript">
	function chkads() {
		if (lf_addstu.txtid.value == "") {
			alert("编号不能为空.");
			lf_addstu.txtid.select();
			return false;
		}
		if (!IsNum(lf_addstu.txtid.value)) {
			alert("编号请输入数字!")
			lf_addstu.txtid.focus();
			return false;
		}
		if (lf_addstu.txtname.value == "") {
			alert("姓名不能为空.");
			lf_addstu.txtname.select();
			return false;
		}

		if (lf_addstu.txtsex.value == "") {
			alert("性别不能为空.");
			lf_addstu.txtsex.select();
			return false;
		}
		if (lf_addstu.txtfamilyName.value == "") {
			alert("民族不能为空.");
			lf_addstu.txtfamilyName.select();
			return false;
		}

		if (lf_addstu.txtbirthday.value == "") {
			alert("出生年月不能为空.");
			lf_addstu.txtbirthday.select();
			return false;
		}
		if (lf_addstu.txtpartyStanding.value == "") {
			alert("党龄不能为空.");
			lf_addstu.txtpartyStanding.select();
			return false;
		}
		if (!IsNum(lf_addstu.txtpartyStanding.value)) {
			alert("党龄请输入数字!")
			lf_addstu.txtpartyStanding.focus();
			return false;
		}
		if (lf_addstu.txteducation.value == "") {
			alert("学历不能为空.");
			lf_addstu.txteducation.select();
			return false;
		}
		if (lf_addstu.txtposted.value == "") {
			alert("曾任党内职务不能为空.");
			lf_addstu.txtposted.select();
			return false;
		}
		if (lf_addstu.txtdeliveryHours.value == "") {
			alert("流出时间不能为空.");
			lf_addstu.txtdeliveryHours.select();
			return false;
		}
		if (lf_addstu.txtexitType.value == "") {
			alert("外出类型不能为空.");
			lf_addstu.txtexitType.select();
			return false;
		}
		if (lf_addstu.txtoutgoingFlow.value == "") {
			alert("外出流向不能为空.");
			lf_addstu.txtoutgoingFlow.select();
			return false;
		}
		if (lf_addstu.txtpartyOrganizationCategory.value == "") {
			alert("党组织类别不能为空.");
			lf_addstu.txtpartyOrganizationCategory.select();
			return false;
		}
		if (lf_addstu.txtcontactWithPartyBranch.value == "") {
			alert("与党支部联系情况不能为空.");
			lf_addstu.txtcontactWithPartyBranch.select();
			return false;
		}
		if (lf_addstu.txtoutflowBranchContactName.value == "") {
			alert("流出支部联系人不能为空.");
			lf_addstu.txtoutflowBranchContactName.select();
			return false;
		}
		if (lf_addstu.txtoutflowBranchContactPhone.value == "") {
			alert("流出支部联系方式不能为空.");
			lf_addstu.txtoutflowBranchContactPhone.select();
			return false;
		}
		if (lf_addstu.txtinflowBranchContactName.value == "") {
			alert("流入支部联系人不能为空.");
			lf_addstu.txtinflowBranchContactName.select();
			return false;
		}
		if (lf_addstu.txtinflowBranchContactPhone.value == "") {
			alert("流入支部联系方式不能为空.");
			lf_addstu.txtinflowBranchContactPhone.select();
			return false;
		}
		if (lf_addstu.txtinflowBranchContactPhone.value == "") {
			alert("联系电话不能为空.");
			lf_addstu.txtinflowBranchContactPhone.select();
			return false;
		}


		if (!IsNum(lf_addstu.txtinflowBranchContactPhone.value)) {
			alert("流入联系方式请输入数字!")
			lf_addstu.txtinflowBranchContactPhone.focus();
			return false;
		}
		if (lf_addstu.txtqqNumber.value == "") {
			alert("QQ号不能为空.");
			lf_addstu.txtqqNumber.select();
			return false;
		}
		if (!IsNum(lf_addstu.txtqqNumber.value)) {
			alert("QQ号请输入数字!")
			lf_addstu.txtqqNumber.focus();
			return false;
		}


	}
	function IsNum(num) {
		var reNum = /^\d*$/;
		return (reNum.test(num));
	}
</script>
</head>

<body>
	<%
		int id = Integer.parseInt(request.getParameter("id"));
		FlowInfoServiceImpl flowSer = new FlowInfoServiceImpl();
		FlowInfo flow = flowSer.findById(id);
	%>
	<form onSubmit="return chkads()" name="lf_addstu"
		action="./FlowInfoUpdaetServlet" method="post">
		<table class="table table-striped table-bordered table-condensed list">

			<tr>
				<td>编号：</td>
				<td>姓名：</td>
				<td>性别：</td>
				<td>民族：</td>
				<td>出生年月：</td>
			</tr>
			<tr class="demo">
				<td><input type="text" name="txtid" readonly
					value="<%=flow.getId()%>"></td>
				<td><input type="text" name="txtname"
					value="<%=flow.getName()%>"></td>
				<td><input type="text" name="txtsex" value="<%=flow.getSex()%>"></td>
				<td><input type="text" name="txtfamilyName"
					value="<%=flow.getFamilyName()%>"></td>
				<td><input type="text" name="txtbirthday"
					value="<%=DateUtil.utilDateTosqlDate(flow.getBirthday())%>"></td>


			</tr>
			<tr>
				<td>党龄：</td>
				<td>学历：</td>
				<td>曾任党内职务：</td>
				<td>流出时间：</td>
				<td>外出类型：</td>
			</tr>
			<tr class="demo">
				<td><input type="text" name="txtpartyStanding"
					value="<%=flow.getPartyStanding()%>"></td>
				<td><input type="text" name="txteducation"
					value="<%=flow.getEducation()%>"></td>
				<td><input type="text" name="txtposted"
					value="<%=flow.getPosted()%>"></td>
				<td><input type="text" name="txtdeliveryHours"
					value="<%=DateUtil.utilDateTosqlDate(flow.getDeliveryHours())%>"></td>

				<td><input type="text" name="txtexitType"
					value="<%=flow.getExitType()%>"></td>
			</tr>

			<tr>
				<td>外出流向：</td>
				<td>党组织类别：</td>
				<td>与党支部联系情况：</td>
				<td>是否持有流动党员证：</td>
				<td>流出支部联系人：</td>
			</tr>
			<tr class="demo">
				<td><input type="text" name="txtoutgoingFlow"
					value="<%=flow.getOutgoingFlow()%>"></td>
				<td><input type="text" name="txtpartyOrganizationCategory"
					value="<%=flow.getPartyOrganizationCategory()%>"></td>
				<td><input type="text" name="txtcontactWithPartyBranch"
					value="<%=flow.getContactWithPartyBranch()%>"></td>
				<td>
					<%
						if (flow.isMobilePartyCard() == false) {
					%> <input type="radio" name="txtstatus" value="true" />是&nbsp;&nbsp;&nbsp;&nbsp;
					<input type="radio" name="txtstatus" value=false checked />否 <%
						} else {
					%> <input type="radio" name="txtstatus" value="true" checked />是&nbsp;&nbsp;&nbsp;&nbsp;
					<input type="radio" name="txtstatus" value=false />否 <%
						}
					%>
				</td>


				<td><input type="text" name="txtoutflowBranchContactName"
					value="<%=flow.getOutflowBranchContactName()%>"></td>
			</tr>
			<tr>
				<td>流出支部联系方式：</td>
				<td>流入支部联系人：</td>
				<td>流入支部联系方式：</td>
				<td>联系电话：</td>
				<td>qq号：</td>
			</tr>
			<tr class="demo">
				<td><input type="text" name="txtoutflowBranchContactPhone"
					value="<%=flow.getOutflowBranchContactPhone()%>"></td>
				<td><input type="text" name="txtinflowBranchContactName"
					value="<%=flow.getInflowBranchContactName()%>"></td>
				<td><input type="text" name="txtinflowBranchContactPhone"
					value="<%=flow.getInflowBranchContactPhone()%>"></td>
				<td><input type="text" name="txtcontactNumber"
					value="<%=flow.getContactNumber()%>"></td>
				<td><input type="text" name="txtqqNumber"
					value="<%=flow.getQqNumber()%>"></td>
			</tr>
			<tr>
				<td>微信号：</td>
				<td>部门编号</td>

			</tr>
			<tr class="demo">
				<td><input type="text" name="txtwechatNumber"
					value="<%=flow.getWechatNumber()%>"></td>
				<td><input type="text" name="txtdepartmentId"
					value="<%=flow.getDepartmentId()%>"></td>

			</tr>
			<tr>
				<td colspan="6"><input class="btn btn-inverse" type="submit"
					name="input" value="修改" /></td>
			</tr>
		</table>

	</form>

</body>
</html>
